<template>
  <div class="">
    <footer class="footer" v-show="left">
      <span class="todo-count"
        ><strong> {{ left }} </strong>剩余</span
      >
      <ul class="filters">
        <li>
          <a
            :class="{ selected: type === 'all' }"
            href="#/"
            @click="changeType('all')"
            >全部</a
          >
        </li>
        <li>
          <a
            :class="{ selected: type === 'active' }"
            href="#/active"
            @click="changeType('active')"
            >进行中</a
          >
        </li>
        <li>
          <a
            :class="{ selected: type === 'completed' }"
            href="#/completed"
            @click="changeType('completed')"
            >已完成</a
          >
        </li>
      </ul>
      <button class="clear-completed" @click="clearDoneList" v-show="isDoneAll">
        清除已完成
      </button>
    </footer>
  </div>
</template>
<script>
export default {
  name: 'ToFooter',
  props: {
    left: {
      type: Number,
      required: true
    },
    isDoneAll: {
      type: Boolean,
      required: true
    },
    type: {
      type: String,
      required: true
    }
  },
  components: {},
  data () {
    return {}
  },
  computed: {},
  watch: {},
  methods: {
    clearDoneList () {
      this.$emit('clearDoneList')
    },
    changeType (type) {
      this.$emit(' changeType', type)
    }
  },
  created () {},
  mounted () {},
  beforeDestroy () {}
}
</script>
<style lang="less" scoped></style>
